package com.example.front.dao;

import cn.hutool.http.HttpRequest;
import com.example.gok_mall.entity.User;
import com.example.gok_mall.reponseData.ResultData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import javax.servlet.http.HttpServletRequest;


@Mapper
public interface UserDao {

    User queryUserByUsernameAndPassword(String username, String password);

    String queryUserPasswordQuestion(String username);

    int checkUserPasswordAnswer(String username, String question ,String answer);

    //String resetPasswordByToken(User user, HttpServletRequest httpServletRequest);
    //忘记密码状态下重置密码
    int updatePasswordByUsername(@Param("username") String username, @Param("password") String password);

    int updateUser(User user);

    int addUser(User user);

    int checkUsername(String username);

    int checkEmail(String email);

    String resetPassword(String password);

    //登录状态下重置密码
    String resetPassword(String passwordOld, String passwordNew, User user);

    int checkPassword(@Param("password") String password, @Param("userId") Integer userId);

    int updateByPrimaryKeySelective(User record);

}
